<template>
  <header class="top-navbar">
    <h1>个人信息</h1>
    <el-button type="danger" class="logout-button" @click="handleLogout">退出</el-button>
  </header>
</template>

<script>
export default {
  name: 'TopNavbar',
  methods: {
    handleLogout() {
      // 执行退出操作，例如清除用户信息
      this.$router.push('/login');
    }
  }
};
</script>

<style scoped>
.top-navbar {
  background-color: #333;
  color: #fff;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logout-button {
  background-color: #f56c6c;
  border-color: #f56c6c;
  color: #fff;
}

.logout-button:hover {
  background-color: #f78989;
  border-color: #f78989;
}
</style>
